//
//  HRMineButtonCell.m
//  Hear
//
//  Created by mac on 2017/6/14.
//  Copyright © 2017年 mac. All rights reserved.
//

#import "HRMineButtonCell.h"
#import "UIButton+SSEdgeInsets.h"
@interface HRMineButtonCell ()
@property (nonatomic, strong)UIButton *button;

@end
@implementation HRMineButtonCell
-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        UIButton *button = [UIButton buttonWithType:0];
        button.frame = self.bounds;

        [button setTitleColor:FirstTextColor forState:UIControlStateNormal];
        button.titleLabel.font = CustomUIFont(14);
        [button addTarget:self action:@selector(buttonClick) forControlEvents:UIControlEventTouchUpInside];
        [self addSubview:(self.button = button)];

    }
    return self;
}

- (void)buttonClick{
    if (self.clickindexBlock){
        self.clickindexBlock();
    }
}

- (void)configureCellWithContent:(NSString *)contentStr{
    [self.button setTitle:contentStr forState:UIControlStateNormal];
    [self.button setImage:[UIImage imageNamed:contentStr] forState:UIControlStateNormal];
    [self.button setImagePositionWithType:SSImagePositionTypeTop spacing:5];

}

@end
